/*
 * @FileName: [RechargeCardTradeService.java] 
 * @Package com.bcinfo.iccard.service 
 * 
 * 
 * Copyright (c) 2011-2015 BCINFO Technology Limited Com.
 * All rights reserved.
 * 
 * This software is the confidential and proprietary 
 * information of BCINFO Technology Limited Company
 * ("Confidential Information"). You shall not disclose 
 * such Confidential Information and shall use it only
 * in accordance with the terms of the contract agreement 
 * you entered into with RKY.
 * 
 * $Rev: 576 $
 * $LastChangedDate: 2013-12-18 15:42:01 +0800 (Wed, 18 Dec 2013) $
 * $LastChangedBy: wanggc $
 * 
 * @category ICCARD
 * @version 1.1
 * @author $Author: wanggc $
 *
 * Change History:[Formatter: author date description] <br/>
 * 1
 * 2
 * 3
*/


package com.bcinfo.iccard.service;

import com.bcinfo.iccard.exception.IccardDatabaseException;
import com.bcinfo.iccard.model.RechargeablecardExpensiveRecordTemp;

/**
 * 充值卡交易服务 <br/>
 * <p>Description:<br/>
 *    <p>TODO 提供充值卡预消费、拨正、查询等方法
 *
 * <p>For Examples <br/>
 * <PRE>
 *      
 * </PRE>
 * <p>
 */
public interface RechargeCardTradeService
{
    /**
     * 根据最后一笔正确流水号拨正失败交易
     *  <br/>
     * <p>Description: 修改该批失败交易状态由预交易为异常，并且将消费款反馈给卡
     * <br/>只针对指定的商家下的某个pos机有效
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-11-下午04:46:34<br/>
     * <p>
     * @param merchantCode 商家编码
     * @param posCode pos编码
     * @param serialNum 流水号
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public void feedBackFailedTradeByMerPos(String merchantCode,String posCode,String serialNum) throws IccardDatabaseException;
    /**
     * 新增预交易
     * <br/>
     * <p>Description: 新交易来了之后先入预交易表
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-11-下午04:49:09<br/>
     * <p>
     * @param temp 预交易
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public RechargeablecardExpensiveRecordTemp addTempExpensive(RechargeablecardExpensiveRecordTemp temp) throws IccardDatabaseException;
    /**
     * 
     * 更新预交易 <br/>
     * <p>Description: TODO(详细描述) 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-11-下午05:02:24<br/>
     * <p>
     * @param temp 预交易
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public int update(RechargeablecardExpensiveRecordTemp temp) throws IccardDatabaseException;
    /**
     * 根据流水号查询消费记录
     *  <br/>
     * <p>Description: 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-13-下午04:43:26<br/>
     * <p>
     * @param serialNum 流水号
     * @return
     * @throws IccardDatabaseException   
     *
     */
    public RechargeablecardExpensiveRecordTemp loadBySerialNum(String serialNum) throws IccardDatabaseException;
    /**
     * 消费撤销
     * <p>Description: 根据流水号进行撤销交易 
     * <br/>
     * <p>Author: wangguangchun<br/>
     * <p>Date: 2013-12-13-下午04:51:03<br/>
     * <p>
     * @param 撤销交易
     * @throws IccardDatabaseException   
     *
     */
    public void revocate(RechargeablecardExpensiveRecordTemp temp) throws IccardDatabaseException;
    
}
